﻿using System.Threading.Tasks;

namespace Sidvall.Net.Sms
{
    public class SmsClientManager
    {
        #region Public Members

        public ISmsClient SmsClient { get; set; }

        #region SendAsync

        public async Task SendAsync(string mobileNumber, string body, bool flash)
        {
            await SendAsync(mobileNumber, body, flash, null).ConfigureAwait(false);
        }
        public async Task SendAsync(string mobileNumber, string body, bool flash, string connectionString)
        {
            var message = new SmsMessage()
            {
                MobileNumber = mobileNumber,
                Body = body,
                Flash = flash,
                ConnectionString = connectionString,
            };
            await SendAsync(message).ConfigureAwait(false);
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public async Task SendAsync(SmsMessage message)
        {
            await this.SmsClient.SendAsync(message).ConfigureAwait(false);
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return "SmsClientManager - Sidvall.Net.Sms.ISmsClient";
        }

        #endregion

        #endregion
        #region Constructors

        public SmsClientManager(ISmsClient smsClient)
        {
            this.SmsClient = smsClient;
        }

        #endregion
    }
}
